package day14_io.作业14;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

//分别使用文件流和缓冲流复制一个长度大于100MB的视频文件，并观察效率的差异.G:\数加视频\day13_Io\day13_IO06.mp4
public class 作业3_2 {
    public static void main(String[] args) throws Exception{
        //字节缓冲流
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("G:\\数加视频\\day13_Io\\day13_IO06.mp4"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("G:\\数加视频\\day13_Io\\csw2.mp4"));
        byte[] bytes = new byte[1024];
        int i;
        while ((i=bis.read(bytes))!=-1){
            bos.write(bytes,0,i);
        }
        bis.close();
        bos.close();
    }
}
